package com.lss.loginregister.entity;

import androidx.databinding.ObservableField;

public class Person implements java.io.Serializable {
    private String name;
    private int age;
    public ObservableField<String> ageStr = new ObservableField<>();
    public ObservableField<String> nameStr = new ObservableField<>();

    public Person() {

    }
    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return nameStr.get();
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        try {
            return Integer.parseInt(ageStr.get());
        } catch (NumberFormatException e) {
            return 0;
        }
    }

    public void setAge(int age) {
        this.age = age;
    }


}
